import java.lang.reflect.Method;

/**
 * 
 * @author 
 * 		Lajos-Zoltan Zsombori  (couldnt simply walk into mordor)
 * 		David Schibl (ate all cookies yaam)
 * 		Roman Puenguentzkay (still thinks Santa is real)
 */

public class Test { 
	public static void main(String[] args) {
		//cookieBoxTest();
		//OrderTest();
		FullTest();
	}
	
	public static void FullTest(){
		
		System.out.println("Creating orders....");
		
		Order orderTU = new Order();
		Order orderBilla = new Order();
		Order orderPenny = new Order();
		Order orderMerkur = new Order();
		Order orderSpar = new Order();
		
		//Testen der Untertypbeziehungen
		Dough schokoteig = new DoughChocolate();
		Dough zimtteig = new DoughCinnamonStar();
		Dough murbteig = new DoughShortcrust();
		
		Shape kreis = new ShapeCircle();
		Shape mond = new ShapeMoon();
		Shape weihnachtsmann = new ShapeSanta();
		
		Fill schoko = new FillChocolate();
		Fill marmelade = new FillJam();
		
		orderTU.add(schokoteig, kreis, schoko, 950);
		orderTU.add(zimtteig, mond, marmelade, 850);
		orderTU.add(murbteig, weihnachtsmann, null, 1337);
		
		
		
		
		//Erstellung von weiteren Bestellungen
		orderBilla.add(new DoughChocolate(), new ShapeCircle(), new FillJam(), 500000);
		orderBilla.add(new DoughCinnamonStar(), new ShapeSanta(), null, 150000);
		orderBilla.add(new DoughShortcrust(), new ShapeMoon(), null, 300000);
		orderBilla.add(new DoughChocolate(), new ShapeSanta(), new FillChocolate(), 200000);
		
		orderPenny.add(new DoughCinnamonStar(), new ShapeSanta(), new FillJam(), 12500);
		orderPenny.add(new DoughShortcrust(), new ShapeMoon(), new FillChocolate(),17500);
		orderPenny.add(new DoughShortcrust(), new ShapeCircle(), new FillJam(), 9500);
		orderPenny.add(new DoughChocolate(), new ShapeSanta(), new FillChocolate(), 10000);
		
		orderMerkur.add(new DoughCinnamonStar(), new ShapeCircle(), null, 5500);
		orderMerkur.add(new DoughCinnamonStar(), new ShapeSanta(), null, 4500);
		orderMerkur.add(new DoughCinnamonStar(), new ShapeMoon(), null, 3500);
		orderMerkur.add(new DoughChocolate(), new ShapeCircle(),null, 3000);
		orderMerkur.add(new DoughChocolate(), new ShapeSanta(),null, 3500);
		orderMerkur.add(new DoughChocolate(), new ShapeMoon(),null, 4000);
		orderMerkur.add(new DoughShortcrust(), new ShapeCircle(), null, 2500);
		orderMerkur.add(new DoughShortcrust(), new ShapeSanta(), null, 3500);
		orderMerkur.add(new DoughShortcrust(), new ShapeMoon(), null, 4500);
		
		orderSpar.add(new DoughChocolate(), new ShapeSanta(), new FillChocolate(), 5000);
		orderSpar.add(new DoughChocolate(), new ShapeMoon(), new FillChocolate(), 5100);
		orderSpar.add(new DoughChocolate(), new ShapeCircle(), new FillChocolate(), 5200);
		orderSpar.add(new DoughCinnamonStar(), new ShapeCircle(), null, 3000);
		orderSpar.add(new DoughChocolate(), new ShapeCircle(), null, 3100);
		orderSpar.add(new DoughShortcrust(), new ShapeCircle(), null, 3200);
		orderSpar.add(new DoughCinnamonStar(), new ShapeSanta(), null, 4000);
		orderSpar.add(new DoughChocolate(), new ShapeSanta(), null, 4100);
		orderSpar.add(new DoughShortcrust(), new ShapeSanta(), null, 4200);
		orderSpar.add(new DoughCinnamonStar(), new ShapeMoon(), null, 2000);
		orderSpar.add(new DoughChocolate(), new ShapeMoon(), null, 2100);
		orderSpar.add(new DoughShortcrust(), new ShapeMoon(), null, 2200);
		
		System.out.print("\nOrder TU:\n");
		orderTU.drucke();
		System.out.print("\nOrder Billa:\n");
		orderBilla.drucke();
		System.out.print("\nOrder Penny:\n");
		orderPenny.drucke();
		System.out.print("\nOrder Merkur:\n");
		orderMerkur.drucke();
		System.out.print("\nOrder Spar:\n");
		orderSpar.drucke();
		
		System.out.print("\n#############################################################################");
		System.out.println("\nGoing to bake a whole bunch of cookies (~1.3 Million) and printing cookieboxes...");
		
		Bakery industrieBaeckerei = new Bakery();
		
		CookieBox boxTU = industrieBaeckerei.bakeOrder(orderTU);
		CookieBox boxBilla = industrieBaeckerei.bakeOrder(orderBilla);
		CookieBox boxPenny = industrieBaeckerei.bakeOrder(orderPenny);
		CookieBox boxMerkur = industrieBaeckerei.bakeOrder(orderMerkur);
		CookieBox boxSpar = industrieBaeckerei.bakeOrder(orderSpar);
		
		System.out.print("\nCookieBox TU:\n");
		System.out.print(boxTU.inhalt());
		System.out.print("\nCookieBox Billa:\n");
		System.out.print(boxBilla.inhalt());
		System.out.print("\nCookieBox Penny:\n");
		System.out.print(boxPenny.inhalt());
		System.out.print("\nCookieBox Merkur:\n");
		System.out.print(boxMerkur.inhalt());
		System.out.print("\nCookieBox Spar:\n");
		System.out.print(boxSpar.inhalt());
		
		
		
	}
	
	public static void OrderTest(){
		
		//schau ma mal....
		Order order1 = new Order();
		
		order1.add(new DoughShortcrust(), new ShapeCircle(), new FillChocolate(), 230);
		order1.add(new DoughCinnamonStar(), new ShapeSanta(), null, 180);
		order1.add(new DoughShortcrust(), new ShapeMoon(), null, 150);
		order1.add(new DoughShortcrust(), new ShapeSanta(), new FillChocolate(), 500);
		order1.add(new DoughCinnamonStar(), new ShapeCircle(), new FillJam(), 800);
		 
		order1.drucke();
		
		Bakery backstube = new Bakery();
		CookieBox box1 = backstube.bakeOrder(order1);
		
		System.out.println(box1.inhalt());
		
		
	}
	
	
	public static void cookieBoxTest(){
		Cookie cs1 = new SingleCookie(new DoughShortcrust(), new ShapeCircle());
		Cookie cs2 = new SingleCookie(new DoughShortcrust(), new ShapeMoon());
		Cookie cs3 = new SingleCookie(new DoughShortcrust(), new ShapeSanta());
		Cookie cs4 = new SingleCookie(new DoughChocolate(), new ShapeCircle());
		Cookie cs5 = new SingleCookie(new DoughChocolate(), new ShapeSanta());
		Cookie cs6 = new SingleCookie(new DoughCinnamonStar(), new ShapeCircle());
		Cookie cs7 = new SingleCookie(new DoughCinnamonStar(), new ShapeMoon());
		
		CookieBox kekse = new CookieBox();
		System.out.println(kekse.inhalt());
		kekse.add(cs1);
		kekse.add(cs1);
		kekse.add(cs2);
		kekse.add(cs2);
		kekse.add(cs2);
		kekse.add(cs3);
		kekse.add(cs4);
		kekse.add(cs4);
		kekse.add(cs4);
		kekse.add(cs4);
		kekse.add(cs5);
		kekse.add(cs5);
		kekse.add(cs6);
		kekse.add(cs6);
		kekse.add(cs6);
		kekse.add(cs6);
		kekse.add(cs7);
		System.out.println(kekse.inhalt());

	}
}
